# -*- coding: utf-8 -*-
"""
@Env 
@Time 2024/9/3 上午11:15
@Author yzpang
@Function: 响应体
"""
import pydantic
from pydantic import BaseModel
from typing import Any


class BaseResponse(BaseModel):
    code: int = pydantic.Field(200, description='API status code')
    msg: str = pydantic.Field('success', description='API status message')
    data: Any = pydantic.Field(None, description='API response data')

    class Config:
        json_schema_extra = {
            "example": {
                "code": 200,
                "msg": "success",
                "data": None
            }
        }
